﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Media3D;
using System.ComponentModel;

using SBPweb.Modules.Smartparts;
using SBPweb.Modules.Modularity;

namespace SBPweb.Presentation.Windows.WPF.Controls
{
    public class UserControl3D : UserControl, I3DSmartpart
    {

        #region Private fields

        private IModule pParentModule;
        private bool pIsModal;
        private Point3D pPosition;
        private Size pSize;

        #endregion

        #region Constructor logic

        public UserControl3D()
        {
        }

        public UserControl3D(ModuleBase module)
        {
            pParentModule = module;
        }
        
        #endregion

        #region ISmartpart Members

        public new bool IsVisible
        {
            get
            {
                return base.IsVisible;
            }
            set
            {
                ;
            }
        }

        public bool IsModal
        {
            get
            {
                return pIsModal;
            }
        }

        public IModule ParentModule
        {
            get
            {
                return pParentModule;
            }
        }

        public event EventHandler VisibleChanged;

        public event EventHandler EnabledChanged;

        public event EventHandler TranslationChanged;

        #endregion

        #region I3DSmartpart Members

        [Category("3D")]
        public virtual Point3D Position
        {
            get
            {
                return pPosition;
            }
            set
            {
                pPosition = value;
                if (TranslationChanged != null)
                {
                    TranslationChanged(this, EventArgs.Empty);
                }
            }
        }

        [Category("3D")]
        public virtual Size Size
        {
            get
            {
                return pSize;
            }
            set
            {
                pSize = value;
                if (TranslationChanged != null)
                {
                    TranslationChanged(this, EventArgs.Empty);
                }
            }
        }

        #endregion
    }
}
